<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>
  </head>
  <body>
    <div id="app">
      <button @click=show >点击显示</button>
      <div v-if="open" :style=obj></div>
      <div v-show="open" :style=obj></div>
    </div>
    <script src="./vue.js"></script>
    <script>
      const vm=new Vue({
        el:'#app',
        data:{open:false,obj:{}},
        methods:{
          show(){
            this.open=true
            this.obj={
              background:"gold",
              width:"200px",
              height:"200px",
              border:"1px solid black"
            }
            
          }
        },
       })
    </script>
  </body>
</html>